﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BAL.Entities;
using BAL.Components;
using System.Data;

namespace DigitalAnts.Admin
{
    public partial class ShowProduct : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                clsProduct obj = new clsProduct();
                obj.ProductID = Convert.ToInt32(Request["ProductID"]);
                DataTable dt = clsProductBAL.doProductSelectID(obj);
                txtproduct.Text = dt.Rows[0]["colProduct"].ToString();
                txtproducer.Text = dt.Rows[0]["colProducer"].ToString();
                txtuser.Text = (dt.Rows[0]["colFirstName"].ToString()) + " " + (dt.Rows[0]["colLastName"].ToString());
                txtyear.Text = dt.Rows[0]["colProductionYear"].ToString();
                txtprice.Text = dt.Rows[0]["colPrice"].ToString();
                txtkm.Text = dt.Rows[0]["colKilometersTraveled"].ToString();
                txtcolor.Text = dt.Rows[0]["colColor"].ToString();
                txtcity.Text = dt.Rows[0]["CityName"].ToString();
                txtcc.Text = dt.Rows[0]["colCc"].ToString();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Admin/ProductManager.aspx");
        }
    }
}